package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import static android.view.Gravity.CENTER;
import static android.view.Gravity.CENTER_VERTICAL;

public class linear extends AppCompatActivity {
    private Button back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_linear);
        back = (Button)findViewById(R.id.back);

        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(linear.this,MainActivity.class);
                startActivity(intent);

            }

        });

    }
    public void uc11(View v)
    {
        LinearLayout test=findViewById(R.id.test);
        test.setGravity(Gravity.CENTER);
        test.setOrientation(LinearLayout.HORIZONTAL);
    }
    public void uc12(View v){
        LinearLayout test=findViewById(R.id.test);
        test.setGravity(CENTER);
        test.setOrientation(LinearLayout.VERTICAL);
    }
    public void uc13(View v){
        LinearLayout test=findViewById(R.id.test);
        test.setGravity(Gravity.LEFT|CENTER_VERTICAL);
    }


}